<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		
		<!-- 
		1：实现火狐切换搜索的功能,当选择哪个搜索，切换对应公司的logo图片，
		并且更改表单的action属性，当输入值并点击搜索的时候，能去对应的网站.三个
		网址分别是https://www.baidu.com,https://www.taobao.com和https://www.google.com.hk 
		-->
	</head>
	<body>
		<form action="https://www.baidu.com/s" id="form1" style="width: 400px;     margin: 0 auto;">
			<img src="../homework-imgs/baidu_web.png" alt="">
			<input type="text" name="wd" style="width: 150px;height: 30px;">
			<input type="submit" value="搜索" style="width: 50px;height: 30px;background-color: #f3f3f3;color: black;">
			<br />
			<input type="radio" name="broswer" value="baidu" onclick="change(0)" checked>百度
			<input type="radio" name="broswer" value="guge" onclick="change(1)" >谷歌
			<input type="radio" name="broswer" value="taobao" onclick="change(2)">淘宝
		</form>
		<script>
			var imgs=["../homework-imgs/baidu_web.png","../homework-imgs/google_web.png","../homework-imgs/taobao_shopping.png"];
			var wangzhi=["https://www.baidu.com/s","https://www.google.com.hk","https://s.taobao.com/search"];
			var wbk=["wd","q","q"];
			var  form1=document.getElementById("form1");
			var child=form1.children;
			function change(t){
				
					form1.action=wangzhi[t];
					child[0].src=imgs[t];
					child[1].name=wbk[t];
				
				
			}
		</script>
	</body>
</html>
